Hands-On Full Stack Web Development with Angular 6 and Laravel 5: Become fluent in both frontend and backend web development with Docker, Angular and Laravel by Fernando Monteiro

Hands-On Full Stack Web Development with Angular 6 and Laravel 5: Become fluent in both frontend and backend web development with Docker, Angular and Laravel by Fernando Monteiro

Author:Fernando Monteiro [Monteiro, Fernando]
Language: eng
Format: epub
Tags: COM060160 - COMPUTERS / Web / Web Programming, COM051260 - COMPUTERS / Programming Languages / JavaScript, COM060080 - COMPUTERS / Web / General
Publisher: Packt Publishing
Published: 2018-07-30T23:00:00+00:00


$token = auth()->login($user); return response()->json([ 'access_token' => $token, 'token_type' => 'bearer', 'expires_in' => auth()->factory()->getTTL() * 60 ], 201);

After we created a user, we returned a HTTP status code of 201 with an access_token and an expiry date.

In the login() function:

$current_user = $request->email; return response()->json([ 'access_token' => $token, 'token_type' => 'bearer', 'current_user' => $current_user, 'expires_in' => auth()->factory()->getTTL() * 60 ], 200);

Here, in the login() function, we returned the current user based on the user's email address, an access_token, and the expiry date.

In the logout() function:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.